package com.woniuxy.dao;

import com.woniuxy.entity.RegMessageAndPatient;
import com.woniuxy.entity.RegisterMessage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface RegisterMessageDao {

    /*
     * 按条件查询挂号单信息,并分页
     * */
    List<RegisterMessage> selectRegisterMessageByCondition
    (@Param("registerMessage") RegisterMessage registerMessage,
     @Param("pageIndex") int pageIndex,
     @Param("pageSize") int pageSize);

    //查询前端所需的挂号单信息
    public List<RegMessageAndPatient> selectRegMessageAndPatients
    (@Param("pageIndex") int pageIndex,
     @Param("pageSize") int pageSize);

    //查询前端所需的挂号单信息条数
    public Integer selectRegMessageAndPatientsCount();

    //根据病人姓名查询前端所需的挂号单信息
    public List<RegMessageAndPatient> selectRegMessageAndPatientsByPatientName
    (@Param("pageIndex") int pageIndex,
     @Param("pageSize") int pageSize,
     @Param("patientName")String patientName);

    //根据病人姓名查询前端所需的挂号单信息条数
    public Integer selectCountByPatientName
    (@Param("pageSize") int pageSize,
     @Param("patientName")String patientName);

    //根据医生姓名查询前端所需的挂号单信息
    public List<RegMessageAndPatient> selectRegMessageAndPatientsByDoctorName
    (@Param("pageIndex") int pageIndex,
     @Param("pageSize") int pageSize,
     @Param("doctorName")String doctorName);

    //根据医生姓名查询前端所需的挂号单信息条数
    public Integer selectCountByDoctorName
    (@Param("pageSize") int pageSize,
     @Param("doctorName")String doctorName);

    //通过单号查询挂号单
    RegisterMessage selectByRegisterNo(String registerNo);

    int updateRegisterMessageById(RegisterMessage registerMessage);

    /*
     * 查询符合条件的数据总条数
     * */
    int getRegisterMessageByConditionNum(@Param("registerMessage") RegisterMessage registerMessage);

    //新增一个订单
    int insertRegisterMessage(RegisterMessage registerMessage);
}
